How to install ABINIT on macOS¶
This file describes how to install ABINIT on macOS using one of the following approaches:
- Homebrew package manager
- MacPorts package manager
- Compilation from source
Using homebrew¶
Tested with:
- macOS 10.13 (High Sierra)
- macOS 10.14 (Mojave)
- macOS 10.15 (Catalina)
A Homebrew official formula for ABINIT is available in this github repository.
Prerequisites¶
- Homebrew installed (see: http://brew.sh/#install)
Installing ABINIT¶
Before the first installation, type:
brew tap abinit/tap
To install ABINIT just type:
brew install abinit
and ABINIT should install smoothly with all its dependencies.
Note that:
-
the LibXC and netCDF fallbacks are enabled by default. Wannier90 and BigDFT are not available in Homebrew. AtomPAW can be installed as a separate formula.
-
the following extra options are available for the ABINIT formula:
- –with-testsuite → Run full test suite (time consuming)
- –without-check → Skip build-time tests (not recommended)
- –without-openmp → Disable openMP multithreading
- –without-netcdf → Build without netcdf support
- –without-libxc → Build without libXC support
- –without-fftw → Build without fftw support
- –without-scalapack → Build without scalapack support
Using macports¶
ABINIT is available on the MacPorts project, but it is not necessarily the latest version. The procedure has been tested with Mac OS X v10.8 (Mountain Lion) and v10.15 (Catalina)
Prerequisites:¶
-
MacPorts installed (see https://www.macports.org/install.php)
-
Some basic ports already installed:
- gcc (last version) with Fortran variant (Fortran compiler),
- mpich or openmpi (MPI)
-
Before starting, it is preferable to update the MacPorts system:
sudo port selfupdate sudo port upgrade outdated
Installing ABINIT¶
To install ABINIT, just type:
sudo port install abinit
ABINIT port variants¶
By default, ABINIT is installed with libXC and Wannier90
To activate support for the FFTW3 library:
sudo port install abinit @X.Y.Z +fftw3
To link ABINIT with the parallel Linear Algebra ScaLapack:
sudo port install abinit @X.Y.Z +scalapack
To install a multi-threaded (openMP) version of ABINIT:
sudo port install abinit @X.Y.Z +threads
It is possible to mix all previous variants:
sudo port install abinit @X.Y.Z +fftw3+threads+scalapack
Other options available, see:
port info abinit
Compiling from source under macOS¶
Prerequisites¶
-
macOS
-
Xcode installed with “Xcode command line tools”; just type:
xcode-select --install
-
A Fortran compiler installed. Possible options:
- gfortran-for-macOS project.
- gfortran binary from http://hpc.sourceforge.net
- gfortran binary from https://gcc.gnu.org/wiki/GFortranBinaries#MacOS
- gfortran installed via a package manager (MacPorts, Homebrew, Fink)
- intel Fortran compiler
-
Mandatory libraries.
-
A MPI library installed (if you want to benefit from parallelism; recommended). Possible options:
- mpich from http://www.mpich.org, or via package manager
- open-mpi from http://www.open-mpi.org, or via package manager
-
A Linear Algebra library installed. By default the
accelerate
Framework is installed on macOS and the ABINIT build system should find it. But you might want to install a parallel library:scalapack
,atlas
,mkl
, etc. If ABINIT is linked with the accelerate library, make sure the code is configured with--enable-zdot-bugfix="yes"
. Useotool -L abinit
to print the shared libraries required by the program.
Installing ABINIT from source¶
For normal users it is advised to get the newest version from our website (replace 9.0.4 by the newest version available).
wget https://www.abinit.org/sites/default/files/packages/abinit-9.0.4.tar.gz tar xzf abinit-9.0.4.tar.gz cd abinit-9.0.4
Create a working directory:
mkdir build && cd build
To configure the sequential version, use:
../configure FC=gfortran CC=clang FCFLAGS_EXTRA="-ffree-line-length-none"
For the parallel version (only if MPI installed):
../configure FC=mpif90 CC=mpicc FCFLAGS_EXTRA="-ffree-line-length-none" \ --enable-mpi --enable-mpi-io
Compile with:
make -j4
Install (optional):
make install
Remember that on MacOs, the environment variant LD_LIBRARY_PATH should be replaced by DYLD_LIBRARY_PATH.
Comments¶
To benefit from the optional “fallbacks” (Wannier90
, libPSML
, …),
consult the abinit-fallbacks Project